package hospital.serviceImpl;

import java.util.List;

import hospital.dao.AdminDao;
import hospital.model.EmpInfoModel;
import hospital.model.LoginModel;
import hospital.model.OfficeInfoModel;
import hospital.model.UserInfoModel;
import hospital.service.AdminService;

public class AdminServiceImpl implements AdminService {

	private AdminDao adminDao;

	public AdminDao getAdminDao() {
		return adminDao;
	}

	public void setAdminDao(AdminDao adminDao) {
		this.adminDao = adminDao;
	}

	@Override
	public boolean checkAvailability(String email) {
		return adminDao.selectCheckAvailability(email);
	}

	@Override
	public boolean checkSinUnique(String sin) {
		return adminDao.selectCheckSinUnique(sin);
	}

	@Override
	public boolean checkOffice(String officePhone) {
		return adminDao.selectCheckOffice(officePhone);
	}

	@Override
	public OfficeInfoModel getOfficeInfo(String officePhone) {
		return adminDao.selectGetOfficeInfo(officePhone);
	}

	@Override
	public boolean createEmp(LoginModel loginInfo, EmpInfoModel empInfo) {
		return adminDao.insertCreateEmp(loginInfo, empInfo);
	}

	@Override
	public List<UserInfoModel> getUserResult(long userId, String firstname, String lastname) {
		return adminDao.selectGetUserResult(userId, firstname, lastname);
	}

	@Override
	public boolean resetPassword(long userId) {
		return adminDao.updateResetPassword(userId);
	}

}
